import request from '@/utils/request'

// 查询模具维修作业列表
export function listModelRepair(query) {
  return request({
    url: '/device/modelRepair/list',
    method: 'get',
    params: query
  })
}

// 查询模具维修作业详细
export function getModelRepair(xmlId) {
  return request({
    url: '/device/modelRepair/' + xmlId,
    method: 'get'
  })
}

// 新增模具维修作业
export function addModelRepair(data) {
  return request({
    url: '/device/modelRepair',
    method: 'post',
    data: data
  })
}

// 修改模具维修作业
export function updateModelRepair(data) {
  return request({
    url: '/device/modelRepair',
    method: 'put',
    data: data
  })
}

// 删除模具维修作业
export function delModelRepair(xmlId) {
  return request({
    url: '/device/modelRepair/' + xmlId,
    method: 'delete'
  })
}

// 导出模具维修作业
export function exportModelRepair(query) {
  return request({
    url: '/device/modelRepair/export',
    method: 'get',
    params: query
  })
}

// 下模维修接口
export function updateUnloadModelRepair(xmlId) {
  return request({
    url: '/device/modelRepair/unload/' + xmlId,
    method: 'put'
  })
}

// 维修完成接口
export function finishModelRepair(data) {
  return request({
    url: '/device/modelRepair/finish',
    method: 'put',
    data: data
  })
}

// 根据模具编号和日期查询
export function listModelByMjbh(mjmMjbh,recentYear,recentMonth) {
  return request({
    url: '/device/modelRepair/listModel',
    method: 'get',
    params: {
      xmlMjbh: mjmMjbh,
      params: {
        year: recentYear,
        month: recentMonth
      }
    }
  })
}
